Public-key cryptography refers to a cryptographic algorithm which requires the use of a private key and a public key. Although different, the two keys in the key pair are mathematically linked. It is computationally easy for a user to generate his or her public and private key pair and to use them for encryption and decryption. It is computationally infeasible for a properly generated private key to be determined from its corresponding public key. Thus, the public key may be published without compromising security, whereas the private key must not be revealed.
Secure shell authentication (SSH) uses public-key cryptography to authenticate a remote user attempting to access a computer (or server). One conventional approach in SSH is to allow users (or programs) to log into a desired computer without having to specify a password. In this approach, anyone can produce a matching pair of different keys consisting of a public key and a private key. The public key is placed on all computers that must allow access to the owner of the matching private key, where the owner of the private key keeps the private key secret.